

import java.util.LinkedList;
import java.util.List;
import java.util.Random;

public class Deck {
	List<Card> deck;
	public Deck() {
		deck = new LinkedList<Card>();
		int index = 0;
		for(int i = 0; i < 4; i++)
			for(int j=1; j<14; j++)
			{
				deck.add(new Card(i, j, index));
				index++;
			}
		this.Shuffle();
	}
	private void Shuffle() {
		List<Card> temp = new LinkedList<Card>();
		Random r = new Random();
		for(int i=52; i>0; i--)
			temp.add(deck.remove(r.nextInt(i)));
		deck = temp;
	}
	public Card remove() {
		return deck.remove(0);
	}
	public String toString(){
		return deck.toString();		
	}
	public int size(){
		return deck.size();
	}
}
